package com.nutiteq.mapper;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import com.nutiteq.log.Log;

public class Mapper extends MIDlet {
  public static Mapper instance;
  private MapScreen screen;

  public Mapper() {
    instance = this;
  }

  protected void destroyApp(final boolean arg0) throws MIDletStateChangeException {
    screen = null;
    instance.notifyDestroyed();
    instance = null;
  }

  protected void pauseApp() {

  }

  protected void startApp() throws MIDletStateChangeException {
    Log.enableAll();
    if (screen == null) {
      screen = new MapScreen();
    }

    Display.getDisplay(this).setCurrent(screen);
    screen.repaint();
  }
}
